<iv class="row" ng-controller="DocumentListCtrl"> <toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<div class="col-lg-12 col-sm-12 col-xs-12">
	<div class="well with-header">
		<div class="header bordered-palegreen">文档查询</div>
		<form id="searchForm">
			<div class="row">
				<div class="col-md-6">
					<div class="form-group">
						<label class="control-label">主文件</label> <input type="text" class="form-control" name="mainFileName" placeholder="请输入主文件名称">
					</div>
				</div>
				<div class="col-md-6">
					<div class="form-group">
						<label class="control-label">状态</label> <select class="select" name="status">
							<option value="">全部</option>
							<option value="true">运行中</option>
							<option value="false">关闭中</option>
						</select>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-md-6">
					<button class="btn btn-primary" ng-click="search()">
						<i class="fa fa-search"></i>查询
					</button>
				</div>
				<div class="col-md-6">
					<button class="btn btn-primary" ng-click="scanning()">
						<i class="fa fa-search"></i>扫描
					</button>
				</div>
			</div>
		</form>
	</div>
</div>
<div class="col-lg-12 col-sm-12 col-xs-12">
	<div class="widget">
		<div class="widget-header bordered-bottom bordered-blue">
			<span class="widget-caption">文件夹</span>
			<div class="widget-buttons">
				<a href="" widget-maximize="" class="warning"><i class="fa fa-expand"></i></a> <a href="" widget-collapse="" class="red"><i class="fa fa-minus"></i></a>
			</div>
		</div>
		<div class="widget-body treeDiv" style="height: 358px;">
			<ul id="treeDemo" class="ztree"></ul>
		</div>
	</div>
</div>


<!-- 
<div class="col-lg-6 col-sm-6 col-xs-6">
	<div class="widget">
		<div class="widget-header bordered-bottom bordered-blue">
			<span class="widget-caption">文件上传</span>
		</div>
		<div class="widget-body" >
			<form id="documentForm" role="form" beforeloadfile="beforeLoadFile" callback="dropzoneCallback" enctype="multipart/form-data" method="POST" class="dropzone" dropzone="file" action="file/upload">
					<div class="form-group">
						<label class="control-label">上传文件夹路径</label> 
						<input type="text" class="form-control" id="uploadPath" value="{{path}}" name="uploadPath" placeholder="上传路径" readonly="readonly" />
					</div>
					<div class="well">
						<div class="dz-default dz-message dz-preview"></div>
					</div>
					<script type="text/javascript">
						Dropzone.autoDiscover = false;
					</script>
			</form>
			<button class="btn btn-success" ng-click="uploadFile()">Upload File</button>
			<button class="btn btn-danger" ng-click="reset()">Reset Dropzone</button>
		</div>
	</div>
</div>
 -->
<div class="col-lg-12 col-sm-12 col-xs-12">
	<div class="widget">
		<div class="widget-header bordered-bottom bordered-blue">
			<span class="widget-caption">文件列表</span>
		</div>
		<div class="widget-body">
			<div>
				<table id="table" class="data-list fix-header" cellspacing=0 cellpadding=0 width="100%">
					<!-- appKey: "" -->
					<!-- code: "5791aff7234735af3d8b57a8" -->
					<!-- contentType: "image/png" -->
					<!-- createTime: 1469165559698 -->
					<!-- createUser: null -->
					<!-- documentName: "557f847f9203d62058197d5.png" -->
					<!-- expiredTime: -1 -->
					<!-- extension: "png" -->
					<!-- group: null -->
					<!-- id: "5791aff7234735af3d8b57aa" -->
					<!-- imageHeight: null -->
					<!-- imageWidth: null -->
					<!-- invalidTime: null -->
					<!-- originaId: "578e2cd923479adfd06fea7a" -->
					<!-- originalName: "557f847f9203d62058197d5.png" -->
					<!-- traceSource: "e6d7435a-acb6-48a2-9788-cda53f77983b" -->
					<!-- updateUser: null -->
					<!-- uploadDate: 1469165559692 -->
					<!-- userUser: null -->
					<!-- versionNo: 1029600 -->
					<!-- versionNumber: "1.2.96" -->
					<thead>
						<tr>
							<th width="5%">序号</th>
							<th width="10%" column="pid">PID</th>
							<th width="10%" column="mianFile">主文件</th>
							<th width="25%" column="folder">文件夹</th>
							<th width="10%" column="startTime">启动时间</th>
							<th width="10%" column="endTime">关闭时间</th>
							<th width="5%" column="runTime">运行时长</th>
							<th width="5%" column="standUpTime">启动时长</th>
							<th width="5%" column="stauts">状态</th>
							<th width="5%" column="stauts">是否守护</th>
							<th width="20%">操作</th>
						</tr>
					</thead>
					<tbody>

					</tbody>
				</table>
			</div>
		</div>
	</div>
</iv>

<script type="text/ng-template" id="edit.html">
		<div class="modal-header" style="    border-bottom: 3px solid #ed4e2a">
            <h3 class="modal-title">编辑文件</h3>
        </div>
		<div class="modal-body">
			<div class="row detail">
                <div class="col-md-12">
                    <div class="form-group">
						<label class="control-label">编辑{{filename}}</label> 
						<textarea class="form-control" rows="10" ng-model="fileText"></textarea>
                    </div>
                </div>
            </div>
		</div>
		<div class="modal-footer">
            <button class="btn btn-warning" ng-click="cancel()">返回</button>
			<button class="btn btn-blue" ng-click="ok()">保存/修改</button>
        </div>
	</script>

<script type="text/ng-template" id="renameFile.html">
		<div class="modal-header" style="    border-bottom: 3px solid #ed4e2a">
            <h3 class="modal-title">修改目录名称</h3>
        </div>
		<div class="modal-body">
			<div class="row detail">
                <div class="col-md-12">
                    <div class="form-group">
						<label class="control-label">原目录名称</label> 
						<input type="text" class="form-control" value="{{dirPath}}" name="dirPath" placeholder="原目录名称" readonly="readonly" />
                    </div>
                </div>
            </div>
			<div class="row detail">
				<div class="col-md-12">
					<div class="form-group">
						<label class="control-label">新目录名称</label> 
						<input type="text" class="form-control" ng-model="dirName" value="" name="dirName" placeholder="新目录名称" />
					</div>
				</div>
			</div>
		</div>
		<div class="modal-footer">
			<!--
            <button class="btn btn-warning" ng-click="cancel()">返回</button>
			-->            
			<button class="btn btn-blue" ng-click="ok()">修改</button>
        </div>
	</script>

<script type="text/ng-template" id="gc.html">
	<div class="modal-header" style="    border-bottom: 3px solid #ed4e2a">
            <h3 class="modal-title">GC监控</h3>
        </div>
		<div class="modal-body" >
			<div class="row detail">
                <div class="col-md-6">
                    <div id="eden" class="chart chart-sm" style="margin-top: 10px;width:100%;">
				    </div>
                </div>
				 <div class="col-md-6">
                    <div id="survivor1" class="chart chart-sm" style="margin-top: 10px;width:100%;">
					</div>
                </div>
            </div>
			<div class="row detail">
				<div class="col-md-6">
					<div id="survivor2" class="chart chart-sm" style="margin-top: 10px;width:100%;">
            		</div>
                </div>
				<div class="col-md-6">
					<div id="old" class="chart chart-sm" style="margin-top: 10px;width:100%;">
           			</div>
                </div>
			</div>
			<div>&nbsp;</div>
		</div>
		<div class="modal-footer">
			<!--
            <button class="btn btn-warning" ng-click="cancel()">返回</button>
			-->            
			<button class="btn btn-blue" ng-click="ok()">返回</button>
        </div>
</script>

<script type="text/ng-template" id="makeDir.html">
		<div class="modal-header" style="    border-bottom: 3px solid #ed4e2a">
            <h3 class="modal-title">创建文件夹</h3>
        </div>
		<div class="modal-body">
			<div class="row detail">
                <div class="col-md-12">
                    <div class="form-group">
						<label class="control-label">创建文件夹路径</label> 
						<input type="text" class="form-control" value="{{dirPath}}" name="dirPath" placeholder="创建路径" readonly="readonly" />
                    </div>
                </div>
            </div>
			<div class="row detail">
				<div class="col-md-12">
					<div class="form-group">
						<label class="control-label">文件夹名称</label> 
						<input type="text" class="form-control" ng-model="dirName" value="" name="dirName" placeholder="文件夹名称" />
					</div>
				</div>
			</div>
		</div>
		<div class="modal-footer">
			<!--
            <button class="btn btn-warning" ng-click="cancel()">返回</button>
			-->            
			<button class="btn btn-blue" ng-click="ok()">创建</button>
        </div>
	</script>

<script type="text/ng-template" id="upload.html">
		<div class="modal-header" style="    border-bottom: 3px solid #ed4e2a">
            <h3 class="modal-title">上传文件</h3>
        </div>
	
        <div class="modal-body">
			<form id="documentForm" role="form" beforeloadfile="beforeLoadFile" callback="dropzoneCallback" enctype="multipart/form-data" method="POST" class="dropzone" dropzone="file" action="file/upload">
            <div class="row detail">
                <div class="col-md-12">
                    <div class="form-group">
						<label class="control-label">上传文件夹路径</label> 
						<input type="text" class="form-control" id="uploadPath" value="{{uploadPath}}" name="uploadPath" placeholder="上传路径" readonly="readonly" />
                    </div>
                </div>
            </div>
			<div class="row detail">
				<div class="col-md-12">
					<div class="well">
						<div class="dz-default dz-message dz-preview"></div>
					</div>
				</div>
			</div>
			</form>
        </div>
        <div class="modal-footer">
			<!--
            <button class="btn btn-warning" ng-click="cancel()">返回</button>
			-->            
			<button class="btn btn-blue" ng-click="ok()">返回</button>
        </div>
	</script>

<script type="tpl" id="program_list_tpl">
         {@each list as item,index}
         <tr>
             <td><label>&{parseInt(index)+1}</label></td>
			 <td><label>&{item.pid == null ? '-' : item.pid}</label></td>
             <td><label>&{item.mianFile == null ? '' : item.mianFile}</label></td>
             <td>
				<label><a href="javascript:void(0);" ng-click="toFileTree('&{item.folder == null ? '' : item.folder}')" >&{item.folder == null ? '' : item.folder}</a></label>
			 </td>
             <td><label>&{item.startTime == null ? '-' : new Date(item.startTime).format()}</label></td>
             <td><label>&{item.endTime == null ? '-' : new Date(item.endTime).format()}</label></td>
             <td><label>&{item.runTime == null ? '-' : item.runTime+'分钟'}</label></td>
			 <td><label>&{item.standUpTime == null ? '-' : item.standUpTime+'秒'}</label></td>
             <td><label class="checkbox"><input ng-click="toProgram('&{item.folder}',&{!item.stauts})" class="checkbox-slider slider-icon colored-blue" type="checkbox" &{item.stauts ? 'checked=checked' : ''}><span class="text"></span></label></td>
			 <td><label class="checkbox"><input ng-click="toGuard('&{item.folder}',&{!item.guard})" class="checkbox-slider toggle colored-blue" type="checkbox" &{item.guard ? 'checked=checked' : ''}><span class="text"></span></label></td>
			 <td>
				<ul >
					<li ng-click="structure('&{item.mianFile}','&{item.folder}')" class="btn btn-default btn-xs black">
						<i class="fa fa-retweet"></i>初始化
					</li>
					<li ng-click="recovery('&{item.folder}')" class="btn btn-default btn-xs black">
						<i class="fa fa-remove"></i>删除
					</li>
				</ul>
			 </td>
         </tr>
         {@/each}
</script>